package com.sinosoft.sm.system.resource.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.sinosoft.sm.system.common.utils.ObjectUtil;
import com.sinosoft.sm.system.resource.entity.ResourceEntity;

public class ResourceData implements Serializable{

private static final long serialVersionUID = 1L;
	
	private String id;   //id
	
	private String pid;  //父标识
	
	private String name;  //资源描述
	
	private String url;   //资源路径
	
	private String creater; 
	
	private Date createtime;
	
	private List<ResourceData> children;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	
	public List<ResourceData> getChildren() {
		return children;
	}

	public void setChildren(List<ResourceData> children) {
		this.children = children;
	}

	/**
	 * 数据转换
	 * 实体类转传输类
	 * @param userEntity	用户实体数据
	 */
	public void toResourceData(ResourceEntity resourceEntity) {
		ObjectUtil.oldToNew(this, resourceEntity, "serialVersionUID");
	}
	
	/**
	 * 数据转换
	 * 传输类转实体类
	 * @return	用户实体数据
	 */
	public ResourceEntity toResourceEntity() {
		ResourceEntity resourceEntity = new ResourceEntity();
		ObjectUtil.oldToNew(resourceEntity, this, "serialVersionUID");
		return resourceEntity;
	}
}
